package com.athuiju.fenxiaoback.controller;


import com.athuiju.fenxiaoback.entity.PmsSpuGenericParamValue;
import com.athuiju.fenxiaoback.entity.TbSpu;
import com.athuiju.fenxiaoback.service.PmsSpuGenericParamValueService;
import com.athuiju.fenxiaoback.utils.R;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author athuiju
 * @since 2021-07-15
 */
//@CrossOrigin
@Api(description = "商品参数",tags = "商品参数")
@RestController
@RequestMapping("/fenxiaoback/pms-spu-generic-param-value")
public class PmsSpuGenericParamValueController {

@Autowired
    PmsSpuGenericParamValueService paramValueService;

    @ApiOperation(value = "获取商品参数")
    @GetMapping("getGoodParams/{spuid}")
    public R getGoodParams(@ApiParam("示例：1") @PathVariable String spuid){
        QueryWrapper<PmsSpuGenericParamValue> spuWrapper=new QueryWrapper<>();
        spuWrapper.eq("spu_id",spuid);
        List<PmsSpuGenericParamValue> list = paramValueService.list(spuWrapper);
        return R.ok().put("data",list);
    }

}

